window.onload = function() {

	var operationUl = document.getElementById("operation");
	var operationLi = operationUl.getElementsByTagName("li");
	var listdiv = document.getElementsByClassName("list");
	
//	右边div显示初始化
	for(var i=0;i<listdiv.length;i++){
		listdiv[i].style.display = "none";	
	}
	listdiv[0].style.display = "block";
	
	
	for(var i = 0; i < operationLi.length; i++) {
		operationLi[i].index=i;
		operationLi[i].onclick = function() {
			
			for(var j = 0; j < operationLi.length; j++) {
				operationLi[j].className = "";
				listdiv[j].style.display="none";
			}
			this.className = "active";
			
			listdiv[this.index].style.display="block";
    
    
		}
	}
	
	
	

	//显示已完成和未完成

}

function qiehuan(id){
	var nowUl = document.getElementById(id);
	var nowLi = nowUl.getElementsByTagName("li");
	for(var i = 0; i < nowLi.length; i++) {
		nowLi[i].onclick = function() {
			for(var j = 0; j < nowLi.length; j++) {
				nowLi[j].className = "";
			}
			this.className = "now";
			
		}
		
	}
	}


function grade(score){
	var s = document.getElementById("pingStar");
				    m = document.getElementById("dir"),
				    n = s.getElementsByTagName("li"),
				    input = document.getElementById("startP");//保存所选值
				   
				    
	//显示现在的得分			  
				    	for(var i = 0;i < score;i++){
							n[i].className = "on";;
						}
				    m.innerHTML = n[score-1].getAttribute("title");
				   				    
				    
	//点击评分			    
				clearAll = function(){
					for(var i = 0;i < n.length;i++){
						n[i].className = "";
					}
				}
				for(var i = 0;i < n.length;i++){
					n[i].onclick = function(){
						var q = this.getAttribute("rel");
						clearAll();											
						input.value = q;
						for(var i = 0;i < q;i++){
							n[i].className = "on";
						}
						m.innerHTML = this.getAttribute("title");
					}
					n[i].onmouseover = function(){
						var q = this.getAttribute("rel");
						clearAll();
						for(var i = 0;i < q;i++){
							n[i].className = "on";
						}
						m.innerHTML = this.getAttribute("title");
					}
					n[i].onmouseout = function(){
						clearAll();
						for(var i = 0;i < input.value;i++){
							n[i].className = "on";
						}
						
					}
				}
}
